from django.conf.urls import url

from myadmin.views import index,users,hosts,usage

urlpatterns = [
    # 后台首页
    url(r'^$', index.index, name="myadmin_index"),

    # 后台管理员路由
    url(r'^login$', index.login, name="myadmin_login"),
    url(r'^dologin$', index.dologin, name="myadmin_dologin"),
    url(r'^logout$', index.logout, name="myadmin_logout"),
    url(r'^verify$', index.verify, name="myadmin_verify"), #验证码

    # 会员信息管理路由
    url(r'^users/(?P<pIndex>[0-9]+)$', users.index, name="myadmin_users_index"),
    url(r'^users/add$', users.add, name="myadmin_users_add"),
    url(r'^users/insert$', users.insert, name="myadmin_users_insert"),
    url(r'^users/del/(?P<uid>[0-9]+)$', users.delete, name="myadmin_users_del"),
    url(r'^users/edit/(?P<uid>[0-9]+)$', users.edit, name="myadmin_users_edit"),
    url(r'^users/update/(?P<uid>[0-9]+)$', users.update, name="myadmin_users_update"),
    url(r'^users/resetpass/(?P<uid>[0-9]+)$', users.resetpass, name="myadmin_users_resetpass"),
    url(r'^users/updatepass/(?P<uid>[0-9]+)$', users.updatepass, name="myadmin_users_updatepass"),

    # 主机信息管理路由
    url(r'^hosts/(?P<pIndex>[0-9]+)$', hosts.index, name="myadmin_hosts_index"),
    url(r'^hosts/add$', hosts.add, name="myadmin_hosts_add"),
    url(r'^hosts/insert$', hosts.insert, name="myadmin_hosts_insert"),
    url(r'^hosts/del/(?P<hid>[0-9]+)$', hosts.delete, name="myadmin_hosts_del"),
    url(r'^hosts/edit/(?P<hid>[0-9]+)$', hosts.edit, name="myadmin_hosts_edit"),
    url(r'^hosts/update/(?P<hid>[0-9]+)$', hosts.update, name="myadmin_hosts_update"),

    # 查看主机使用率路由
    url(r'^usage/(?P<hid>[0-9]+)$', usage.index, name="myadmin_usage_index"),
    url(r'^usage/cpu/(?P<hid>[0-9]+)$', usage.cpu, name="myadmin_usage_cpu"),
    url(r'^usage/mem/(?P<hid>[0-9]+)$', usage.mem, name="myadmin_usage_mem"),
    url(r'^usage/disk/(?P<hid>[0-9]+)$', usage.disk, name="myadmin_usage_disk"),
]
